import request from '@/utils/request_1'

// 新增收货任务
export const addTaskReceive = (params: any) =>
  request({
    url: '/receiving',
    method: 'post',
    data: { ...params }
  })

// 新增收货任务
export const updateTaskReceive = (params: any) =>
  request({
    url: '/receiving',
    method: 'put',
    data: { ...params }
  })

// 删除收货任务
export const deleteTaskReceive = (params: any) =>
  request({
    url: '/receiving',
    method: 'delete',
    params
  })

// 收货完成
export const completeTaskReceive = (params: any) =>
  request({
    url: '/receiving/complete',
    method: 'put',
    data: params
  })

// 分配收货任务
export const distributeTaskReceive = (params: any) =>
  request({
    url: '/receiving/distribute',
    method: 'put',
    data: { ...params }
  })

// 查询全部收货任务
export const findAllTaskReceive = (params: any) =>
  request({
    url: '/receiving/list',
    method: 'get',
    params
  })

// 分页查询收货任务
export const findTaskReceivePaging = (params: any) =>
  request({
    url: '/receiving/page',
    method: 'get',
    params
  })

// 分页查询收货任务明细
export const findTaskReceiveDetailPaging = (params: any) =>
  request({
    url: '/receiving/pageDetail',
    method: 'get',
    params
  })

// 查询收货任务
export const findOneTaskReceive = (id: string) =>
  request({
    url: `/receiving/${id}`,
    method: 'get'
  })
